package com.cust.cow.service.impl;

import com.cust.cow.common.Result;
import com.cust.cow.mapper.PillMapper;
import com.cust.cow.pojo.pill;
import com.cust.cow.service.PillService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PillServiceImpl implements PillService {
    @Autowired
    public PillMapper pillMapper;
    @Override
    public List<pill> findPillAll() {
        return pillMapper.findPillAll();
    }

    @Override
    public pill findPillByName(Integer pillId) {
        return pillMapper.findPillByName(pillId);
    }

    @Override
    public Result insertPill(pill pill) {
        pillMapper.insertPill(pill);
        return new Result(200, "插入成功");
    }

    @Override
    public Result deletePill(Integer pillId) {
        pillMapper.deletePill(pillId);
        return new Result(200, "删除成功");
    }
}
